//
//  ViewController.m
//  MJ_ImageCache
//
//  Created by apple on 16/5/14.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "ViewController.h"
#import "MJImageCache.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIImage *image= [UIImage imageNamed:@"pic_k1.jpg"];
    
    MJImageCache *imageCache = [MJImageCache shareImageCache];
    
    [imageCache insertImageToCache:image key:@"kenan" pngYn:NO toDisk:YES];
    
    UIImage *image2 = [imageCache selectImageFromCache:@"kenan"];
    
    UIImageView *view = [[UIImageView alloc] initWithImage:image2];
    view.frame = CGRectMake(10, 10, 200, 200);
    
    [self.view addSubview:view];
    [view release];
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
